package org.apache.qpid.management.common.sasl;

import de.measite.smack.Sasl;
import java.util.Map;
import org.apache.harmony.javax.security.auth.callback.CallbackHandler;
import org.apache.harmony.javax.security.sasl.SaslClient;
import org.apache.harmony.javax.security.sasl.SaslClientFactory;
import org.apache.harmony.javax.security.sasl.SaslException;

public class CRAMMD5HashedSaslClientFactory
  implements SaslClientFactory
{
  public static final String MECHANISM = "CRAM-MD5-HASHED";

  public SaslClient createSaslClient(String[] paramArrayOfString, String paramString1, String paramString2, String paramString3, Map<String, ?> paramMap, CallbackHandler paramCallbackHandler)
    throws SaslException
  {
    for (int i = 0; i < paramArrayOfString.length; i++)
      if (paramArrayOfString[i].equals("CRAM-MD5-HASHED"))
      {
        if (paramCallbackHandler == null)
          throw new SaslException("CallbackHandler must not be null");
        String[] arrayOfString = { "CRAM-MD5" };
        return Sasl.createSaslClient(arrayOfString, paramString1, paramString2, paramString3, paramMap, paramCallbackHandler);
      }
    return null;
  }

  public String[] getMechanismNames(Map paramMap)
  {
    return new String[] { "CRAM-MD5-HASHED" };
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.apache.qpid.management.common.sasl.CRAMMD5HashedSaslClientFactory
 * JD-Core Version:    0.6.1
 */